

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>计数器 - layui 第三方扩展组件示例</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="https://www.layuicdn.com/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="../numberInput.css" media="all">
</head>
<body>

<div style="padding: 50px;">  
  <div class="layui-numbox">
    <button class="layui-btn-numbox-minus" type="button">-</button>
    <input class="layui-input-numbox" type="number">
    <button class="layui-btn-numbox-plus" type="button">+</button>
  </div>
</div>


<script src="https://www.layuicdn.com/layui/layui.js"></script>
<script>
layui.config({
  base: '../' //配置 layui 第三方扩展组件存放的基础目录
}).extend({
  numberInput: 'numberInput'
}).use(['numberInput'], function(){
  var numberInput = layui.numberInput;
  var numInputIns = numberInput.render({
	step: 1,
	min: 1,
	max: 150
  });
  //console.log(numInputIns.getCurrentNumber());
  numInputIns.setInitNumber(5);
  
});
</script>
</body>
</html>


